export default {
  //首页树
    loadHomePageServer(params, callback) {
        Vue.http.get('/appcategory/site.json', { params: params }).then(function(response) {
            callback(response.data);
        });
    },
  // 添加分类
  addHomePageServer(params, callback_success, callback_error) {
      Vue.http.post('/appcategory/add.json', params).then(response => {
          callback_success(response.data);
      }, response => {
          callback_error(response.data)
      });
  },
  // 删除分类
  deleteHomePageServer(params,callback) {
    Vue.http.delete('/appcategory/remove.json',{params:params}).then(response=>{
      callback(response.data);
    });
  },
  // 编辑分类
  editHomePageServer(params, callback_success, callback_error) {
      Vue.http.put('/appcategory/modify.json', params).then(response => {
          callback_success(response.data);
      }, response => {
          callback_error(response.data)
      });
  },
  // 推荐
  recommendServer(params, callback_success, callback_error) {
    Vue.http.put('/appcategory/recommend/dorecommend.json', params).then(response => {
      callback_success(response.data);
    }, response => {
      callback_error(response.data)
    });
  },
  //取消推荐
  cancelRecommendServer(params, callback_success, callback_error) {
    Vue.http.put('/appcategory/recommend/cancel.json', params).then(response => {
      callback_success(response.data);
    }, response => {
      callback_error(response.data)
    });
  },
  //删除文件
  deleteFileServer(params,callback) {
    Vue.http.delete('/file/delete.json',{params:params}).then(response=>{
      callback(response.data);
    });
  },
}

